<?php include atemplate("header");?>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" bgcolor="#969696"><strong>作 品 管 理</strong></td>
      </tr>
    </table>
    <br />
	<form action="index.php?do=image&job=list" method="POST"> 
    <table  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="200"><input name="keyword" type="text" id="keyword" size="28" value='<?php  echo $keyword;?>' /></td>
        <td width="60"><select name="option" id="option">
          <option value="1" <?php if($option=='1'){ echo "selected";}?>>作者</option>
          <option value="2"  <?php if($option=='2'){ echo "selected";}?>>作品</option>
        </select>
        </td>
		<td>&nbsp;排序
	<select name="order" id="order" onchange="showOrder();">
		<option value="createtime" <?php if($order=='createtime'){ echo "selected";}?>>发布时间</option>
		<option value="votenum" <?php if($order=='votenum'){ echo "selected";}?>>按照票数</option>
	</select></td>
        <td width="50" align="left"><input type="submit" name="button13" id="button13" value="搜索" /></td>
      </tr>
    </table>
	</form>
    <br />
	<?php 
		foreach($result as  $key=>$array){
	?>
    <table width="660" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="200" height="120" align="center"><a href="../photo.php?id=<?php echo $array['id'];?>" target="_blank"><img src="../<?php  echo $array['imageurl'];?>" width="150" height="90" border="0" /><br />
        </a>票数：<?php echo $array['votenum'];?></td>
        <td align="center" valign="top"><table width="460" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="40"><span class="STYLE3">标题：</span></td>
            <td width="200" align="left"><?php echo $array['title'];?></td>
            <td width="40" class="STYLE3">作者：</td>
            <td width="60" align="center"><?php echo $array['author'];?></td>
            <td width="40" class="STYLE3">电话：</td>
            <td width="80" height="40" align="center"><?php echo $array['phone'];?></td>
          </tr>
        </table>
          <table width="460" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="60" align="left" valign="top" class="STYLE3">作品描述：</td>
              <td align="left" valign="top"><?php echo $array['description'];?></td>
            </tr>
          </table>
          <table width="90%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="40" align="right"><input type="button" name="button4" id="button4" value="管理" onclick="updateImage(<?php echo $array['id'];?>)"/>　
                <input type="button" name="button5" id="button5" value="删除" onclick="deleteImage(<?php echo $array['id'];?>)"/>                </td>
            </tr>
          </table></td>
      </tr>
    </table>
    <table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" class="text_2">.......................................................................................................................................................................................................</td>
      </tr>
    </table>
  <?php } ?>
    <table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
		<td align="center" class="page"><?php echo $pagetag;?></td>
	  </tr>
	</table>
<script language="javascript">
function updateImage(id){
	document.location.href = "index.php?do=image&job=edit&id="+id;
}

function deleteImage(id){
	if(confirm("确认删除么？")){
		document.location.href = "index.php?do=image&job=delete&id="+id;
	}
}
function showOrder(){
	document.location.href= "index.php?do=image&job=list&order="+$("#order").val()+"&keyword=<?php echo $keyword;?>&option=<?php echo $option;?>"
}
$(function(){
//	$("img").each(function(){
//		
//	});
});
</script>
<?php include atemplate("footer");?>